<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> 
    <title> - 天地维杰网</title>
    <meta name="keywords" content="系统架构,shutdown,不与天斗,Domino,博客,程序员,架构师,笔记,技术,分享,java,Redis">
    
    <meta property="og:title" content="">
    <meta property="og:site_name" content="天地维杰网">
    <meta property="og:image" content="/img/author.jpg"> 
    <meta name="title" content=" - 天地维杰网" />
    <meta name="description" content="天地维杰网 | 博客 | 软件 | 架构 | Java "> 
    <link rel="shortcut icon" href="http://www.shutdown.cn/img/favicon.ico" />
    <link rel="apple-touch-icon" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link rel="apple-touch-icon-precomposed" href="http://www.shutdown.cn/img/apple-touch-icon.png" />
    <link href="http://www.shutdown.cn/js/vendor/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/main.css" rel="stylesheet" type="text/css" />
    <link href="http://www.shutdown.cn/css/syntax.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
     fancybox: true, 
    motion: true
  };
</script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7826003325059020" crossorigin="anonymous"></script>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<div class="container one-collumn sidebar-position-left page-home  ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"> <div class="site-meta  custom-logo ">

  <div class="custom-logo-site-title">
    <a href="http://www.shutdown.cn"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">天地维杰网</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">人如秋鸿来有信，事若春梦了无痕</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
    <ul id="menu" class="menu">
      
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />首页
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/redis/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-full"></i> <br />Redis
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/java/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-coffee"></i> <br />java
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/linux/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-linux"></i> <br />linux
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/daily/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bug"></i> <br />日常问题
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/spring/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-child"></i> <br />Spring和Springboot
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/mac/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-fire"></i> <br />Mac相关
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/middleware/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-gavel"></i> <br />中间件
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jiagou/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-rocket"></i> <br />架构
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/python/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-ship"></i> <br />python
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/front/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-bolt"></i> <br />前端
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/jvm/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-balance-scale"></i> <br />jvm
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/c/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-battery-empty"></i> <br />c语言
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/categories/web3/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-web3"></i> <br />web3
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/post/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />归档
          </a>
        </li>
      
        <li class="menu-item ">
          <a href="http://www.shutdown.cn/about/" rel="section">
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />关于
          </a>
        </li>
      
      <li class="menu-item menu-item-search">
        <a href="javascript:;" class="popup-trigger"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br /> 搜索</a>
      </li>
    </ul>
    <div class="site-search">
      <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>

    </div>
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
<section id="posts" class="posts-expand">
  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <header class="post-header">
      <h1 class="post-title" itemprop="name headline">
        <a class="post-title-link" href="http://www.shutdown.cn/post/redis7.0%E6%96%B0%E7%89%B9%E6%80%A7-listpack%E6%9B%BF%E6%8D%A2ziplist/" itemprop="url">
        
        </a>
      </h1>
      <div class="post-meta">
      <span class="post-time">
<span class="post-meta-item-icon">
    <i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">时间：</span>
<time itemprop="dateCreated" datetime="2016-03-22T13:04:35+08:00" content="0001-01-01">
    0001-01-01
</time>
</span> 
      
      
       <span>
&nbsp; | &nbsp;
<span class="post-meta-item-icon">
    <i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">阅读：</span>
<span class="leancloud-visitors-count">728 字 ~4分钟</span>
</span>
      </div>
    </header>
    <div class="post-body" itemprop="articleBody">
    

    

<blockquote>
<p>源文地址：<a href="https://mp.weixin.qq.com/s/4xdAWJHWg0vui8DRvNVHTQ">https://mp.weixin.qq.com/s/4xdAWJHWg0vui8DRvNVHTQ</a></p>
</blockquote>

<h1 id="redis7-ziplist的替代者listpack">Redis7&ndash;ziplist的替代者listpack</h1>

<h3 id="一-ziplist简介">一、ziplist简介</h3>

<p>ziplist是一种连续内存空间并且有序的压缩链表，其主要的数据结构如下图：</p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220706191513.png" width = 600 /> </div>

<p>结合以上数据结构的内存模型图，我们可以看出ziplist具有的一些优势与问题：</p>

<table>
<thead>
<tr>
<th align="left">优势</th>
<th align="left">问题</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">1. 具有极高的内存利用率</td>
<td align="left">1. 每次增/删/改需要realloc连续内存空间并进行移动</td>
</tr>

<tr>
<td align="left"></td>
<td align="left">2. 连锁更新问题</td>
</tr>

<tr>
<td align="left"></td>
<td align="left">3. 查找时间复杂度过高的问题 （o(n)）</td>
</tr>

<tr>
<td align="left"></td>
<td align="left">4. ziplist总内存大小限制（4G)</td>
</tr>

<tr>
<td align="left"></td>
<td align="left">5. 元素个数超过65535时统计ziplist元素个数带来的遍历统计问题</td>
</tr>
</tbody>
</table>

<blockquote>
<p><strong><em>什么时候可能会触发连锁更新呢？</em></strong></p>

<p>向ziplist中增加、删除、修改数据内容、合并ziplist场景。</p>

<p><strong><em>为什么会有连锁更新的问题？</em></strong></p>

<p>从上图的数据结构中可以看到，在实际数据的内存结构前有prevlen与encoding字段，当其发生变化时可能会导致内存不连续，为了保证内存中数据的连续，所以可能会触发连锁更新。</p>
</blockquote>

<h3 id="二-listpack简介">二、listpack简介</h3>

<p>由于ziplist存在不可避免的问题 &ndash; <strong>连锁更新问题</strong>， 所以在Redis 5版本中，推出了ziplist替代版本listpack。</p>

<h4 id="1-ziplist整体的结构与listpack的整体结构对比">1. ziplist整体的结构与listpack的整体结构对比</h4>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220706191716.png" width = 900 /> </div>

<p>从以上整体的对比图可以看到，其实两者结构相差不大，listpack相对于ziplist，没有了指向末尾节点地址的偏移量，这样也可以解决<strong><em>ziplist内存长度限制的问题</em></strong>。</p>

<h4 id="2-entry结构对比">2. entry结构对比</h4>

<p>其数据结构对比如下图：</p>

<div  align="center"><img src="https://wejack639.oss-cn-beijing.aliyuncs.com/blogimages/img/20220706191731.png" width = 400 /> </div>

<p>从以上结构中可以看到，listpack移除了prevlen，在data后新增了backlen，两者有着本质区别：</p>

<ul>
<li>在ziplist中，prevlen代表前一个entry节点长度的偏移量；</li>
<li>在listpack中，backlen代表的是本entry节点的回朔起始地址长度的偏移量</li>
</ul>

<p>Entry这样设计具有以下一些<strong>优势</strong>：</p>

<ul>
<li>在遍历最后一个entry时可以通过lp+totallen快速定位到lp尾地址，然后使用backlen快速定位到last entry的起始地址；***并且可以将head中的last offset字段节省出来；</li>
<li>由于backlen仅代表了回朔本entry起始地址长度的偏移量，所以在增/删/改时，无需再关心前一个节点的长度，<strong><em>仅需要整体移动entry即可，所以不会涉及到内存的连锁更新</em></strong>；具体的代码流程这里不再复述；</li>
</ul>

<h3 id="三-listpack替换quicklist收益">三、listpack替换quicklist收益</h3>

<h4 id="1-list相关命令性能对比-quicklist-with-ziplist-quicklist-with-listpack">1. list相关命令性能对比（quicklist with ziplist -&gt; quicklist with listpack)</h4>

<blockquote>
<p><strong>注意：以下测试结果摘自redis-pr #9740.</strong></p>
</blockquote>

<table>
<thead>
<tr>
<th align="left">command</th>
<th align="left">quicklist listpack(rps)</th>
<th align="left">quicklist ziplist(rps)</th>
<th align="left">percentage(positive: performance enhancement, negative: performance degradation)</th>
</tr>
</thead>

<tbody>
<tr>
<td align="left">LPUSH</td>
<td align="left">106929 rps, p50=0.223</td>
<td align="left">103535.75 rps, p50=0.223</td>
<td align="left"><strong>3.2%</strong></td>
</tr>

<tr>
<td align="left">LRANGE_100</td>
<td align="left">65737.58 rps, p50=0.375</td>
<td align="left">67333.27 rps, p50=0.375</td>
<td align="left"><strong>-2.3%</strong></td>
</tr>

<tr>
<td align="left">LRANGE_300</td>
<td align="left">30900.44 rps, p50=0.839</td>
<td align="left">31346.00 rps, p50=0.823</td>
<td align="left"><strong>-1.4%</strong></td>
</tr>

<tr>
<td align="left">LRANGE_500</td>
<td align="left">22126.59 rps, p50=1.175</td>
<td align="left">22689.63 rps, p50=1.159</td>
<td align="left"><strong>-1.4%</strong></td>
</tr>

<tr>
<td align="left">LRANGE_600</td>
<td align="left">19443.90 rps, p50=1.343</td>
<td align="left">19690.08 rps, p50=1.327</td>
<td align="left"><strong>-1.2%</strong></td>
</tr>

<tr>
<td align="left">RPUSH</td>
<td align="left">109075.04 rps, p50=0.223</td>
<td align="left">108283.71 rps, p50=0.223</td>
<td align="left"><strong>0.7%</strong></td>
</tr>

<tr>
<td align="left">LPOP</td>
<td align="left">108636.61 rps, p50=0.223</td>
<td align="left">110778.77 rps, p50=0.223</td>
<td align="left"><strong>1.9%</strong></td>
</tr>

<tr>
<td align="left">RPOP</td>
<td align="left">109757.44 rps, p50=0.223</td>
<td align="left">109206.08 rps, p50=0.223</td>
<td align="left"><strong>0.5%</strong></td>
</tr>
</tbody>
</table>

<p>从以上结果可以看到，<strong><em>lpush/rpush/lpop/rpop性能略有提升</em></strong>，这得益于listpack避免了连锁更新的问题，符合预期；但是<strong><em>lrange性能下降</em></strong>是因为在lpNext与lpGet函数中需要计算整个entry的长度（包括计算data长度与backlen）以及进行有效性验证，在代码逻辑上相较于ziplistNext/ziplistGet要复杂一些。</p>

<h4 id="2-hash-zset类命令性能影响">2. hash/zset类命令性能影响</h4>

<p>由于hash与zset类命令，具有两种编码模式，默认为ziplist，在entry个数达到配置的默认值时，会将数据结构分别转换为hash与skiplist，所以<strong><em>在entry个数较少时，性能影响不大；entry个数越长、变更更频繁，新版本会具有更好的性能</em></strong>，而且在实际业务场景中，这个值都不会被配置的很大，所以这里也不再测试，仅从理论上推测性能影响。</p>

<h4 id="3-关于rdb的性能影响">3. 关于RDB的性能影响</h4>

<p>由于ziplist和listpack都是一段连续的内存，所以在写入和加载上，性能不会有明显的差异。</p>

<h4 id="4-rdb加载时ziplist转换为listpack时的耗时">4. RDB加载时ziplist转换为listpack时的耗时</h4>

<p>低版本的RDB在redis7中加载时，会自动将ziplist转换为listpack，其<strong>整体加载耗时会大约增加 *9%-54%*</strong> <strong>左右</strong>。</p>

<p>具体耗时结果如下：</p>

<ul>
<li>List（38%-46%）</li>
</ul>

<blockquote>
<p>注意：以下数据摘自 redis-pr #9740</p>
</blockquote>

<p>| list size | quicklist length per list | quicklist ziplist loading time(second) | quicklist listpack loading and convert time(second) | convert cost time(second) | degradation percentage    | rdb size |
  | :&mdash;&mdash;&ndash; | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;- | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&ndash; | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; | :&mdash;&mdash;- |
  | 250000    | 512                       | 9.053                                  | 13.468                                              | 4.415                     | 48.7%(memory limit reach) | 3.7G     |
  | 250000    | 256                       | 4.752                                  | 6.850                                               | 2.098                     | 44.1%                     | 1.9G     |
  | 250000    | 128                       | 2.555                                  | 3.722                                               | 1.167                     | 45.6%                     | 946M     |
  | 250000    | 64                        | 1.385                                  | 1.999                                               | 0.614                     | 44.3%                     | 486M     |
  | 500000    | 256                       | 9.214                                  | 13.847                                              | 4.633                     | 50.2%(memory limit reach) | 3.7G     |
  | 500000    | 128                       | 4.990                                  | 7.170                                               | 2.18                      | 43.6%                     | 1.9G     |
  | 500000    | 64                        | 2.868                                  | 3.961                                               | 1.093                     | 38.1%                     | 971M     |
  | 500000    | 32                        | 1.703                                  | 2.365                                               | 0.662                     | 38.8%                     | 505M     |</p>

<ul>
<li>hash (29%-54%)</li>
</ul>

<blockquote>
<p>注意：以下数据摘自 redis-pr #8887</p>
</blockquote>

<p>| num of  keys | entries num of one ziplist | entry size | loading time without convert(second) | rdb loading time with convert(second) | degradation  percentage |
  | :&mdash;&mdash;&mdash;&ndash; | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;- | :&mdash;&mdash;&mdash; | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&ndash; | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;- |
  | 1 million    | 128                        | 8  bytes   | 5.893                                | 12.747                                | 53.77%                  |
  | 1 million    | 128                        | 16  bytes  | 7.263                                | 14.727                                | 50.68%                  |
  | 1 million    | 128                        | 24  bytes  | 9.794                                | 16.058                                | 39.01%                  |
  | 1 million    | 128                        | 32  bytes  | 11.636                               | 18.537                                | 37.23%                  |
  | 2 million    | 64                         | 8  bytes   | 7.234                                | 14.366                                | 49.64%                  |
  | 2 million    | 64                         | 16  bytes  | 8.759                                | 16.478                                | 46.84%                  |
  | 2 million    | 64                         | 24  bytes  | 11.095                               | 18.372                                | 39.61%                  |
  | 2 million    | 64                         | 32  bytes  | 14.413                               | 20.607                                | 30.06%                  |
  | 4 million    | 32                         | 8  bytes   | 9.452                                | 16.886                                | 44.02%                  |
  | 4 million    | 32                         | 16  bytes  | 10.685                               | 18.975                                | 43.69%                  |
  | 4 million    | 32                         | 24  bytes  | 13.474                               | 20.824                                | 35.30%                  |
  | 4 million    | 32                         | 32  bytes  | 16.041                               | 22.712                                | 29.37%                  |</p>

<ul>
<li>Zset (9%-16%)</li>
</ul>

<blockquote>
<p>注意：以下数据摘自 redis-pr #9366</p>
</blockquote>

<p>| key num | zset length | loading without convert | loading with convert(after  optimize) | loading with convert(before  optimize) | degradation percentage |
  | :&mdash;&mdash; | :&mdash;&mdash;&mdash;- | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;- | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;- | :&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash; |
  | 500000  | 128         | 5.352s                  | 13.821                                | 15.648                                 | 11.68%                 |
  | 500000  | 64          | 2.983s                  | 7.225                                 | 8.443                                  | 14.43%                 |
  | 500000  | 32          | 1.629s                  | 3.835                                 | 4.217                                  | 9.06%                  |
  | 1000000 | 128         | 10.977s                 | 27.026                                | 31.965                                 | 15.45%                 |
  | 1000000 | 64          | 6.022s                  | 14.28                                 | 16.477                                 | 13.33%                 |
  | 1000000 | 32          | 3.317s                  | 7.522                                 | 8.708                                  | 13.62%                 |</p>

<h3 id="四-ziplist替换为listpack后带来的连锁变更">四、ziplist替换为listpack后带来的连锁变更</h3>

<h4 id="1-相关配置变更">1. 相关配置变更</h4>
<div class="highlight"><pre style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-fallback" data-lang="fallback">* 新增list-max-listpack-size， 是list-max-ziplist-size的别名；
* 新增hash-max-listpack-entries， 是hash-max-ziplist-entries的别名；
* 新增hash-max-listpack-value， 是hash-max-ziplist-value的别名；
* 新增zset-max-listpack-entries， 是zset-max-ziplist-entries的别名；
* 新增zset-max-listpack-value， 是zset-max-ziplist-value的别名；</code></pre></div>
<p><strong><em>由于新增配置均是别名，所以原有针对ziplist的相关配置，均可在redis7中自动生效，无需再做配置修改</em></strong>。</p>

<h4 id="2-rdb相关">2. RDB相关</h4>

<ul>
<li><p>RDB类型新增</p>

<ul>
<li>RDB_TYPE_HASH_LISTPACK</li>
<li>define RDB_TYPE_ZSET_LISTPACK</li>
<li>define RDB_TYPE_LIST_QUICKLIST_2</li>
</ul></li>

<li><p>版本号提升至 <strong><em>10</em></strong></p></li>
</ul>

<p>由于RDB类型和版本号的变更，所以需要更新迁移工具，解析并支持新的类型。</p>

<h3 id="五-参考链接">五、参考链接</h3>

<ol>
<li><strong><em>listpack migration</em></strong> &ndash;  <a href="https://github.com/redis/redis/issues/8702">https://github.com/redis/redis/issues/8702</a></li>
<li><strong><em>replace ziplist with listpack in quicklist</em></strong> &ndash; <a href="https://github.com/redis/redis/pull/9740">https://github.com/redis/redis/pull/9740</a></li>
<li><strong><em>Replace all usage of ziplist with listpack for t_hash</em></strong> &ndash; <a href="https://github.com/redis/redis/pull/8887">https://github.com/redis/redis/pull/8887</a></li>
<li><strong><em>Replace all usage of ziplist with listpack for t_zset</em></strong> &ndash; <a href="https://github.com/redis/redis/pull/9366">https://github.com/redis/redis/pull/9366</a></li>
</ol>

    </div>
    <footer class="post-footer">
     

     <div class="post-nav">
    <div class="post-nav-next post-nav-item">
    
        <a href="http://www.shutdown.cn/post/redis7.0%E6%96%B0%E7%89%B9%E6%80%A7-hashlistzset-%E7%9A%84-ziplist-%E6%9B%BF%E6%8D%A2%E4%B8%BA-listpack/" rel="next" title="">
        <i class="fa fa-chevron-left"></i> 
        </a>
    
    </div>

    <div class="post-nav-prev post-nav-item">
    
        <a href="http://www.shutdown.cn/post/redis7.0%E7%89%88%E6%9C%AC%E4%BB%8B%E7%BB%8D/" rel="prev" title="">
         <i class="fa fa-chevron-right"></i>
        </a>
    
    </div>
</div>
      
     
     
     






    </footer>
  </article>
</section>

          </div>
        </div>
        <div class="sidebar-toggle">
  <div class="sidebar-toggle-line-wrap">
    <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
    <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
  </div>
</div>
<aside id="sidebar" class="sidebar">
  <div class="sidebar-inner">

    <section class="site-overview sidebar-panel  sidebar-panel-active ">
      <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image"
        src="http://www.shutdown.cn/img/author.jpg"
        alt="不与天斗Domino" />
    <p class="site-author-name" itemprop="name">不与天斗Domino</p>
    <p class="site-description motion-element" itemprop="description"> 
        Programmer &amp; Architect</p>
</div>
      <nav class="site-state motion-element">
    <div class="site-state-item site-state-posts">
      <a href="http://www.shutdown.cn/post/">
        <span class="site-state-item-count">183</span>
        <span class="site-state-item-name">日志</span>
      </a>
    </div>
    <div class="site-state-item site-state-categories">    
        <a href="http://www.shutdown.cn/categories/">      
         
        <span class="site-state-item-count">15</span>
        
        <span class="site-state-item-name">分类</span>
        
        </a>
    </div>

    <div class="site-state-item site-state-tags">
        <a href="http://www.shutdown.cn/tags/">
         
        <span class="site-state-item-count">224</span>
        
        <span class="site-state-item-name">标签</span>
        </a>
    </div>
</nav>
      
      

      

      <div class="links-of-blogroll motion-element inline">
<script type="text/javascript" src="//rf.revolvermaps.com/0/0/8.js?i=&amp;m=0&amp;s=220&amp;c=ff0000&amp;cr1=ffffff&amp;f=arial&amp;l=33&amp;bv=35" async="async"></script>
</div>

    </section>
    
  </div>
</aside>

      </div>
    </main>
   
    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  <span itemprop="copyrightYear">  &copy; 
  2013 - 2023</span>
  <span class="with-love"><i class="fa fa-heart"></i></span>
  <span class="author" itemprop="copyrightHolder">天地维杰网</span>
  <span class="icp" itemprop="copyrightHolder"><a href="https://beian.miit.gov.cn/" target="_blank">京ICP备13019191号-1</a></span>
</div>
<div class="powered-by">
  Powered by - <a class="theme-link" href="http://gohugo.io" target="_blank" title="hugo" >Hugo v0.63.2</a>
</div>
<div class="theme-info">
  Theme by - <a class="theme-link" href="https://github.com/xtfly/hugo-theme-next" target="_blank"> NexT
  </a>
</div>


      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
      <span id="scrollpercent"><span>0</span>%</span>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/fastclick/lib/fastclick.min.js?v=1.0.6"></script> 
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.min.js?v=1.2.1"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/vendor/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script src="http://www.shutdown.cn/js/vendor/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>

<script src="http://www.shutdown.cn/js/vendor/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/utils.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/motion.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/affix.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/schemes/pisces.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/scrollspy.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/post-details.js"></script>
<script type="text/javascript" src="http://www.shutdown.cn/js/toc.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/bootstrap.js"></script>

<script type="text/javascript" src="http://www.shutdown.cn/js/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
    tex2jax: {
      inlineMath: [ ['$','$'] ],
      displayMath: [ ['$$','$$'] ],
      processEscapes: true
    },
    "HTML-CSS": { fonts: ["TeX"] }
  });
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML' async></script>
</body>
</html>